<?php
  require("conf/configuration.php");
  require("rssfeed.cls.php");
  require("rssitem.cls.php");
  
  class Feeds {
    
    private $userid;
    
    public function Feeds($userid) {
      $this->userid = $userid;
    }
    
    public function getFeeds() {
      $db = new SQLiteDatabase(DATABASE);
      $dbfeeds = $db->query("select title,url from feeds where user=" . $this->userid . ";");
      $feeds = array();
      foreach($dbfeeds as $feed)
        $feeds[] = new RssFeed($feed["title"], $feed["url"]);
      return $feeds;
    }
    
  }
  
?>